<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
 body{
    width: 100%;
    height: 100vh;
    background: skyblue;
    /* 弹性盒子 */
    /* display:flex;
    align-items: center;
    justify-content: center; */
    position: relative;

 }
 .box{
    width: 200px;
    height: 100px;
    background:#fff;
    position: absolute;
    /* top:50%;
    left:50%; */
    /* translate第一个参数就是x轴，第二个参数就是y轴 */
    /* transform: translate(-50%,-50%); */
    /* calc 计算 */
    top:calc(50% - 50px);
    left:calc(50% - 100px);
    
 }

</style>
<body>
    <div class="box"></div>
</body>
</html>